<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	isELIgnored="false"%>
<%@ taglib prefix="j" uri="/jodd"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'confrimSh.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
<link href="<%=basePath%>/css/tablecloth.css" rel="stylesheet" type="text/css" media="screen" />
<script type="text/javascript" src="<%=basePath%>/js/tablecloth.js"></script>
<script type="text/javascript" src="<%=basePath %>/js/jquery-1.8.0.min.js"></script>
<style type="text/css">
ul{   list-style:none;}
#result {
width:371px;}
#result li{
float:left;
  margin: 10px;
}
#result li.last{
clear:right;
}
</style>
  </head>
  
  <body>
<table cellspacing="0" cellpadding="0">			
	<tr>		
	<th>全选</th>		
		<th>订单编号</th>
		<th>买家呢称</th>
		<th>收货人</th>
		<th>邮费</th>
		<th>金额</th>
		<th>省市</th>
		<th>快递公司</th>
		<th>付款时间</th>
		<th>备注</th>
		<th>操作</th>
	</tr>
  <j:form>
    <form action="<%=basePath%>confirmStockHouse/" method="post">
		<tr>	
		<td><input type="checkbox"  id="allIds" /></td>
		<td><input type="text" name="tid"/></td>
		<td><input type="text" name="buyerNick"/></td>
		<td><input type="text" name="receiverName" style="width: 58px;"></td>
		<td><input type="text" style="width: 40px;"></td>
		<td><input type="text"/></td>
		<td><select name="area">
		<option value="">地区</option>
		<option value="江浙沪">江浙沪</option>
		<option value="东三省">东三省</option>
		<option value="新疆西藏">新疆西藏</option>
		<option value="北京天津">北京天津</option>
		<option value="两湖两广">两湖两广</option>
		<option value="两河两山">两河两山</option>
		<option value="云南贵州">云贵川</option>
		<option value="宁青甘陕">宁青甘陕</option>
		<option value="江西福建安徽">江西福建安徽</option>
		<option value="内蒙古">内蒙古</option>
		<option value="海南">海南</option>
		</select></td>
		<td><select name="express">
		<option value="">快递公司</option>
		<option value="圆通">圆通</option>
		<option value="韵达">韵达</option>
		<option value="中通">中通</option>
		<option value="申通">申通</option>
		</select></td>
		<td><input  type="text" style="width: 84px;"></td>
		<td><select name="memo">
		<option value="all">全部</option>
		<option value="hasmemo">有备注</option>
		<option value="none">无备注</option>
		</select></td>

<td><input type="submit" value="提交"/></td></tr></form></j:form>
	<j:iter items="${storehouses }" var="sh">
	<tr>
		<td><input type="checkbox"  name="ids" value="${sh.tid }"/></td>
		<td>${sh.tid }</td>
		<td>${sh.buyerNick }</td>
		<td>${sh.receiverName }</td>
						<td>${sh.postFee }</td>
								<td>${sh.payment }</td>
		<td>${sh.receiverState }${sh.receiverCity }</td>
		<td>${sh.express }</td>
		<td><fmt:formatDate value="${sh.payTime}" pattern="MM-dd HH:mm" /></td>
<td><j:ifelse test="${not empty sh.sellerMemo || sh.hasBuyerMessage || not empty sh.tradeMemo}">
<j:then>
<a href="" target="_blank"  class="hasmemo">
			<img src="http://a.tbcdn.cn/sys/common/icon/trade/op_memo_1.png" alt="">
   		</a>	
   		<j:if test="${sh.hasBuyerMessage }"><p class="buermessage" style="display:none;">${sh.byerMessage }</p></j:if>
   		<j:if test="${ not empty sh.tradeMemo}"><p class="tradememo" style="display:none;">${sh.tradeMemo }</p></j:if>
   		<j:if test="${not empty sh.sellerMemo }"><p class="sellermemo" style="display:none;">${sh.sellerMemo }</p></j:if>
   		</j:then><j:else><img src="http://a.tbcdn.cn/sys/common/icon/trade/op_memo_0.png" alt=""></j:else></j:ifelse></td>
<td>查看</td>
	</tr></j:iter>
					
</table>
<input id="print" type="button" value="打印">
<ul id="result"></ul>
<script type="text/javascript">
$(document).ready(function(){
$("#print").click(function(){
$("#result").empty();
var ipt=$("input[name='ids']:checked");
var rs="";
ipt.each(function(){
rs=rs+$(this).val()+";";
var li1=$("<li>");
li1.text($(this).val())
var li3=$("<li>");
li3.addClass("last");
li3.append("<input type='text' name='express[]'>")
$("#result").append(li1).append(li3);
});
$.ajax({
                    type : "POST",
                    dataType : "html",
                    url: "<c:url value="./printExpress/"/>",
                    data : {
                        ids : rs,
                    }});
});
$("a.hasmemo").hover(
  function () {
    $(this).parent().find("p").show();
  }, 
  function () {
   $(this).parent().find("p").hide();
  }
);
});
</script>
  </body>
</html>
